

<%@ page import="Biblioteca.Reserva" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <g:if test="${tipo == 'Admin'}">
        	<meta name="layout" content="adminBiblioteca" />
        </g:if>
        <g:else>
        	<meta name="layout" content="usuarioBiblioteca" />
        </g:else>
        <g:set var="entityName" value="${message(code: 'reserva.label', default: 'Reserva')}" />
        <title><g:message code="SPL - Reserva de Itens" args="[entityName]" /></title>
    </head>
    <body>
        <div class="body"> 
            <h1><g:message code="Reserva" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${reservaInstance}">
            <div class="errors">
                <g:renderErrors bean="${reservaInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="Seu login: " /></td>
                            <g:hiddenField name="id" value="${params.itemID}" />
                            <td valign="top" class="value">${params.username}</td>
                            
                        </tr>
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="Item: " /></td>
                            
                            <td valign="top" class="value">${params.item}</td>
                            
                        </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="dataDevolucao"><g:message code="reserva.dataDevolucao.label" default="Data Devolucao" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: reservaInstance, field: 'dataDevolucao', 'errors')}">
                                    <g:datePicker name="dataDevolucao" precision="day" value="${reservaInstance?.dataDevolucao}"  />
                                </td>
                            </tr>
                           <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="dataReserva"><g:message code="reserva.dataReserva.label" default="Data Reserva" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: reservaInstance, field: 'dataReserva', 'errors')}">
                                    <g:datePicker name="dataReserva" precision="day" value="${reservaInstance?.dataReserva}"  />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save"  value="${message(code: 'Confirmar Reserva', default: 'Confirmar Reserva')}" onclick="return confirm('${message(code: 'Voce tem certeza?', default: 'Voce tem certeza?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
